#ifndef RAWSPAGE_H
#define RAWSPAGE_H

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "PropPage.h"
#include "ExListViewCtrl.h"

#include "../client/ClientProfileManager.h"

class RawsPage : public CPropertyPage<IDD_RAWS_PAGE>, public PropPage
{
public:

	RawsPage(SettingsManager *s) : PropPage(s) { 
		SetTitle(CTSTRING(RAW_PROFILES));
	};

	virtual ~RawsPage() { 
		ctrlRaws.Detach();
	};

	BEGIN_MSG_MAP(RawsPage)
		MESSAGE_HANDLER(WM_INITDIALOG, onInitDialog)
		COMMAND_ID_HANDLER(IDC_ADD, onAddRaws)
		COMMAND_ID_HANDLER(IDC_REMOVE, onRemoveRaws)
		COMMAND_ID_HANDLER(IDC_CHANGE, onChangeRaws)
		NOTIFY_HANDLER(IDC_LIST, NM_DBLCLK, onDblClick)
	END_MSG_MAP()

	LRESULT onInitDialog(UINT, WPARAM, LPARAM, BOOL&);

	LRESULT onAddRaws(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
	LRESULT onChangeRaws(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
	LRESULT onRemoveRaws(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
	LRESULT onDblClick(int /*idCtrl*/, LPNMHDR /* pnmh */, BOOL& bHandled) {
		return onChangeRaws(0, 0, 0, bHandled);
	}
	// Common PropPage interface
	PROPSHEETPAGE *getPSP() { return (PROPSHEETPAGE *)*this; }
	virtual void write();
	
protected:
	ExListViewCtrl ctrlRaws;

	static Item items[];
	static TextItem texts[];

	void addEntry(const RawProfile& cp, int pos);
};
#endif //RAWSPAGE_H
/**
 * @file
 * $Id: RawsPage.h 255 2005-07-16 13:06:57Z Flow84 $
 */